package priv.lirenhe.dissertation.dao.mysql.impl;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;

import priv.lirenhe.dissertation.dao.mysql.WebPageMapper;
import priv.lirenhe.dissertation.domain.mysql.WebPage;
import priv.lirenhe.dissertation.domain.mysql.WebPageExample;
import priv.lirenhe.dissertation.domain.mysql.WebPageWithBLOBs;

@Repository("WebPageMapperImpl")
public class WebPageMapperImpl implements WebPageMapper{
	@Resource
	private SqlSessionTemplate sqlSessionTemplate = null;
	

	@Override
	public long countByExample(WebPageExample example) {
		long count = sqlSessionTemplate.selectOne("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.countByExample",example);
		return count;
	}

	@Override
	public int deleteByExample(WebPageExample example) {
		int deleteByExamplNumber = sqlSessionTemplate.delete("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.deleteByExample", example);
		return deleteByExamplNumber;
	}

	@Override
	public int deleteByPrimaryKey(Long webPageId) {
		int deleteByPrimaryKey = sqlSessionTemplate.delete("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.deleteByPrimaryKey",webPageId);
		return deleteByPrimaryKey;
	}

	@Override
	public int insert(WebPageWithBLOBs record) {
		int insertNumber = sqlSessionTemplate.insert("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.insert", record);
		return insertNumber;
	}

	@Override
	public int insertSelective(WebPageWithBLOBs record) {
		int insertSelectiveNumber = sqlSessionTemplate.insert("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.insertSelective", record);
		return insertSelectiveNumber;
	}

	@Override
	public List<WebPageWithBLOBs> selectByExampleWithBLOBs(
			WebPageExample example) {
		List<WebPageWithBLOBs> listOfWebPageWithBLOBs = sqlSessionTemplate.selectList("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.selectByExampleWithBLOBs", example);
		return listOfWebPageWithBLOBs;
	}

	@Override
	public List<WebPage> selectByExample(WebPageExample example) {
		List<WebPage> listOfWebPage = sqlSessionTemplate.selectList("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.selectByExample", example);
		return listOfWebPage;
	}

	@Override
	public WebPageWithBLOBs selectByPrimaryKey(Long webPageId) {
		WebPageWithBLOBs webPageWithBLOBsOfSelectByPrimaryKey = sqlSessionTemplate.selectOne("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.selectByPrimaryKey", webPageId);
		return webPageWithBLOBsOfSelectByPrimaryKey;
	}

	@Override
	public int updateByExampleSelective(WebPageWithBLOBs record,
			WebPageExample example) {
		int updateByExampleSelectiveNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.updateByExampleSelective", example);
		return updateByExampleSelectiveNumber;
	}

	@Override
	public int updateByExampleWithBLOBs(WebPageWithBLOBs record,
			WebPageExample example) {
		int updateByExampleWithBLOBsNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.updateByExampleWithBLOBs", example);
		return updateByExampleWithBLOBsNumber;
	}

	@Override
	public int updateByExample(WebPage record, WebPageExample example) {
		int updateByExampleNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.updateByExample", example);
		return updateByExampleNumber;
	}

	@Override
	public int updateByPrimaryKeySelective(WebPageWithBLOBs record) {
		int updateByPrimaryKeySelectiveNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.updateByPrimaryKeySelective", record);
		return updateByPrimaryKeySelectiveNumber;
	}

	@Override
	public int updateByPrimaryKeyWithBLOBs(WebPageWithBLOBs record) {
		int updateByPrimaryKeyWithBLOBsNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.updateByPrimaryKeyWithBLOBs", record);
		return updateByPrimaryKeyWithBLOBsNumber;
	}

	@Override
	public int updateByPrimaryKey(WebPage record) {
		int updateByPrimaryKeyNumber = sqlSessionTemplate.update("priv.lirenhe.dissertation.dao.mysql.WebPageMapper.updateByPrimaryKey", record);
		return updateByPrimaryKeyNumber;
	}

}
